﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Data;

namespace FusionDotNet.WorkflowActivities
{
    public sealed class InsertActivity : FusionActivityBase<DataTable, SelectResult>
    {
        [RequiredArgument]
        public InArgument<DataTable> RowData { get; set; }

        public override Command<SelectResult> CreateCommand(AsyncCodeActivityContext context)
        {
            return new InsertCommand(context.GetValue(RowData));
        }

        public override DataTable CreateResult(SelectResult commandResult)
        {
            return commandResult.ResultTable;
        }
    }
}
